package priv.conceit.study.book.thread.chapter1.parts5;

/**
 * 1.5.3
 * 线程模拟银行抽号机 runnable接口实现类 测试
 *
 * @author Conceit
 * 2019/6/4 增加方法
 * @since 1.0.0, 2019/6/4
 */
public class TicketWindowRunnableTest {

	public static void main(String[] args) {
		TicketWindowRunnable ticketWindowRunnable = new TicketWindowRunnable();

		//四个窗口 使用同一个runnable接口，这样资源就是共享的，不会再出现每个线程售出一段的情况
		new Thread(ticketWindowRunnable, "1号窗口").start();
		new Thread(ticketWindowRunnable, "2号窗口").start();
		new Thread(ticketWindowRunnable, "3号窗口").start();
		new Thread(ticketWindowRunnable, "4号窗口").start();

	}
}
